<!doctype html>
<!--[if IE 7 ]>
<html lang="zh-cn" class="isie ie7 oldie no-js" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
<!--[if IE 8 ]>
<html lang="zh-cn" class="isie ie8 oldie no-js" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
<!--[if IE 9 ]>
<html lang="zh-cn" class="isie ie9 no-js" xmlns:th="http://www.thymeleaf.org"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="zh-cn" class="no-js" xmlns:th="http://www.thymeleaf.org">
<!--<![endif]-->
<head th:replace="_fragments/header :: head(~{:: title})">
    <title>搜索 ｜ 江文的后端技术小站</title>
</head>

<body class="landing">
<header th:replace="_fragments/nav :: navbar-index"></header>
<div id="#top"></div>
<section id="banner">
    <h2>搜索.WenDev</h2>
    <p>持节云中，何日遣冯唐？</p>
</section>
<!--About-->
<section id="main" class="container">
    <section class="box special">
        <form method="get" action="/search">
            <div class="row uniform half collapse-at-2">
                <div class="9u">
                    <input type="text" name="title" id="query" value="" placeholder="搜索文章"/>
                </div>
                <div class="3u">
                    <input type="submit" value="Search" class="fit alt"/>
                </div>
            </div>
        </form>
        <div th:if="${page.content.size() == 0}">
            <h1>没有数据</h1>
        </div>
        <div th:if="${page.content.size() != 0}">
            <div th:each="article : ${page.content}">
                <header class="major">
                    <h2><a th:href="@{'/article/' + ${article.id}}" th:text="${article.title}"></a></h2>
                    <p th:text="|${#strings.abbreviate(article.content, 400)}|"></p>
                    <div style="color: #666666">
                        <i class="fa fa-calendar" aria-hidden="true" style="margin-right: 5px"></i>
                        <span style="margin-right: 10px"
                              th:text="${#dates.format(article.updateTime, 'yyyy-MM-dd')}"></span>

                        <i class="fa fa-eye" aria-hidden="true" style="margin-right: 5px"></i>
                        <span style="margin-right: 10px" class="info-content" th:text="${article.views}"></span>
                    </div>
                </header>
            </div>
        </div>
        <section id="introText" th:if="${page.content.size() != 0}">
            <div class="text-center" style="margin-top: 50px">
                <a th:if="${page.first == false}" th:href="@{/(page=${page.number} - 1)}" class="btn btn-default"
                   style="margin-right: 30px">
                    <i class="fa fa-angle-double-left" aria-hidden="true"></i> 上一页</a>
                <a th:if="${page.last == false}" th:href="@{/(page=${page.number} + 1)}" class="btn btn-default">下一页
                    <i class="fa fa-angle-double-right" aria-hidden="true"></i></a>
            </div>
        </section>
    </section>
</section>

<footer th:replace="_fragments/footer :: footer"></footer>
</body>
</html>
